﻿using System;
using System.Windows.Controls;
using System.Windows.Input;
using BusinessObjects;

namespace LogInModule.Views
{
	public partial class GameModeSelection : UserControl
	{
		public Action<GameMode> GameModeSelected;
		
		public GameModeSelection()
		{
			InitializeComponent();
		}

        private void singlePlayerButton_Click(object sender, MouseButtonEventArgs e)
        {
            if (this.GameModeSelected != null)
            {
                this.GameModeSelected(GameMode.SinglePlayer);
            }
        }

        private void multiPlayerButton_Click(object sender, MouseButtonEventArgs e)
        {
            if (this.GameModeSelected != null)
            {
                this.GameModeSelected(GameMode.MultiPlayer);
            }
        }

        private void singlePlayerButton_MouseEnter(object sender, MouseEventArgs e)
        {
            this.selectedModeLabel.Text = "single player";
        }

        private void singlePlayerButton_MouseLeave(object sender, MouseEventArgs e)
        {
            this.selectedModeLabel.Text = "";
        }

        private void multiPlayerButton_MouseEnter(object sender, MouseEventArgs e)
        {
            this.selectedModeLabel.Text = "multi player";
        }

        private void multiPlayerButton_MouseLeave(object sender, MouseEventArgs e)
        {
            this.selectedModeLabel.Text = "";
        }
	}
}